/***
* Copyright (c) 2001 Sagem Monetel SA, rue claude Chappe,
* 07503 Guilherand-Granges, France, All Rights Reserved.
*
* Sagem Monetel SA has intellectual property rights relating
* to the technology embodied in this software. In particular,
* and without limitation, these intellectual property rights
* may include one or more patents.
*
* This software is distributed under licenses restricting
* its use, copying, distribution, and decompilation.
* No part of this software may be reproduced in any form
* by any means without prior written authorization of
* Sagem Monetel.
*
* @Title:		TAGS.H
* @Description:	Tags definition (SPDH + generic)
*
* @Company:		SMO
* @Reference:
* @Comment:
*
* @author:
* @version:		1.0
* @Comment:
* @date:		2004/02/09
*/

#ifndef __TAGSH__
#define __TAGSH__


#define PURCHASE_MESSAGE_TYPE                    'F'
#define PRE_AUTHOR_MESSAGE_TYPE                  'F'
#define REFUND_MESSAGE_TYPE                      'F'
#define REVERSAL_MESSAGE_TYPE                    'U'
#define HANDSHAKE_MESSAGE_TYPE                   'F'

#define PURCHASE_TRANS_CODE                    '0'
#define PRE_AUTHOR_TRANS_CODE                  '1'
#define PRE_AUTHORDEBIT_TRANS_CODE             '2'
#define REFUND_TRANS_CODE                      '4'
#define REVERSAL_TRANS_CODE                    '0'
#define HANDSHAKE_TRANS_CODE                   '95'


#define TAG_SPDH_CONNECTION_STATUS                  0x9F811B
#define SPDH_CONNECTION_STATUS_LENGTH               2

#define	SPDH_TAG_CALLING_MODE						0x9F811C
#define CALLING_MODE_LENGTH							1


#define TAG_SPDH_STATUS_CODE			            0x9F8801
#define SPDH_TAG_COMMON_STATUS_CODE					0x9F8801
#define COMMON_STATUS_CODE_LENGTH					2

#define TAG_SPDH_LINK_LAYER_PARAM                   0x9F8810 // (defined by Link Layer)
#define TAG_SPDH_TRANSPORT_LAYER_PARAM              0x9F8811 // (defined by Link Layer)

#define TAG_SPDH_APPLICATION_LAYER_PARAM            0x9F8812
#define SPDH_TAG_APPLICATION_LAYER_PARAM            0x9F8812
#define SPDH_APPLICATION_T_TR_NUMBER_OPTION         0x01
#define SPDH_APPLICATION_L_TR_NUMBER_OPTION         0x01
#define SPDH_APPLICATION_V_TR_NUMBER_ON             1
#define SPDH_APPLICATION_V_TR_NUMBER_OFF            0


#define TAG_SPDH_FULL_MESSAGE_TYPE                  0x9F8813
#define COMM_FULL_MESSAGE_TYPE_LEN                  2

#define TAG_SPDH_PROTOCOL_TYPE                      0x9F8814
#define SPDH_PROTOCOL_TYPE_LENGTH                   4
#define SPDH_PROTOCOL                               0x20000000

#define TAG_SPDH_COMPONENT_VERSION                  0x9F8815
#define SPDH_COMPONENT_VERSION_LENGTH               2

#define TAG_SPDH_PROTOCOL_INFO                      0x9F8816
#define SPDH_PROTOCOL_INFO_LENGTH                   4
#define ASYNCHRONOUS_MODE_SUPPORTED                 0x01000000



// Status values (see SPE-0026)
#define SPDH_SERVICE_COMPLETED                      0x0000
#define SPDH_BUSY                                   0x0010
#define SPDH_REQUEST_ACCEPTED                       0x0010
#define SPDH_SERVICE_NOT_SUPORTED                   0x0103
#define SPDH_ALREADY_CONNECTED                      0x0103
#define SPDH_ACQUIRER_HOST_UNREACHABLE              0x0104
#define SPDH_COMMUNICATION_PROBLEM                  0x0105
#define SPDH_COMMUNICATION_TIMEOUT                  0x0106
#define SPDH_SERVICE_REJECTED                       0x0107



// SPDH HEADER
#define SPDH_TAG_DEVICE_TYPE						0x9F8900
#define DEVICE_TYPE_LENGTH							2
#define SPDH_TAG_TRANSMISSION_NUMBER				0x9F8901
#define TRANSMISSION_NUMBER_LENGTH					2
#define SPDH_TAG_TERMINAL_ID						0x9F8902
#define TERMINAL_ID_LENGTH							16
#define SPDH_TAG_EMPLOYEE_ID						0x9F8903
#define EMPLOYEE_ID_LENGTH							6
#define SPDH_TAG_CURRENT_DATE						0x9F8904
#define CURRENT_DATE_LENGTH							6
#define SPDH_TAG_CURRENT_TIME						0x9F8905
#define CURRENT_TIME_LENGTH							6
#define SPDH_TAG_MESSAGE_TYPE						0x9F8906
#define MESSAGE_TYPE_LENGTH							1
#define SPDH_TAG_MESSAGE_SUBTYPE					0x9F8907
#define MESSAGE_SUBTYPE_LENGTH						1
#define SPDH_TAG_TRANSACTION_CODE					0x9F8908
#define TRANSACTION_CODE_LENGTH						2
#define SPDH_TAG_PROCESSING_FLAG					0x9F8909
#define PROCESSING_FLAG_LENGTH						3
#define SPDH_TAG_RESPONSE_CODE						0x9F890A
#define RESPONSE_CODE_LENGTH						3


// SPDH FIDs
#define SPDH_TAG_BILLING_ADDRESS					0x9F890B	//A
#define BILLING_ADDRESS_LENGTH						20
#define SPDH_TAG_AMOUNT1							0x9F890C	//B
#define AMOUNT1_LENGTH								18
#define SPDH_TAG_AMOUNT2							0x9F890D	//C
#define AMOUNT2_LENGTH								18
#define SPDH_TAG_APP_ACCOUNT_TYPE					0x9F890E	//D
#define APP_ACCOUNT_TYPE_LENGTH						1
#define SPDH_TAG_APP_ACCOUNT_NUMBER					0x9F890F	//E
#define APP_ACCOUNT_NUMBER_LENGTH					19
#define SPDH_TAG_APPROVAL_CODE						0x9F8910	//F
#define APPROVAL_CODE_LENGTH						8
#define SPDH_TAG_AUTHENTICATION_CODE				0x9F8911	//G
#define AUTHENTICATION_CODE_LENGTH					8
#define SPDH_TAG_AUTHENTICATION_KEY					0x9F8912	//H
#define AUTHENTICATION_KEY_LENGTH					16
//#define AUTHENTICATION_KEY_LENGTH					74
#define SPDH_TAG_DATA_ENCRYPTION_KEY				0x9F8913	//I
#define DATA_ENCRYPTION_KEY_LENGTH					16
#define SPDH_TAG_AVAILABLE_BALANCE					0x9F8914	//J
#define AVAILABLE_BALANCE_LENGTH					18
#define SPDH_TAG_BUSINESS_DATE						0x9F8915	//K
#define BUSINESS_DATE_LENGTH						6
#define SPDH_TAG_CHECK_TYPE							0x9F8916	//L
#define CHECK_TYPE_LENGTH							1
#define SPDH_TAG_COMMUNICATIONS_KEY					0x9F8917	//M
#define COMMUNICATIONS_KEY_LENGTH					32
//#define COMMUNICATIONS_KEY_LENGTH					74
#define SPDH_TAG_CUSTOMER_ID						0x9F8918	//N
#define CUSTOMER_ID_LENGTH							40
#define SPDH_TAG_CUSTOMER_ID_TYPE					0x9F8919	//O
#define CUSTOMER_ID_TYPE_LENGTH						2
#define SPDH_TAG_DRAFT_CAPTURE_FLAG					0x9F891A	//P
#define DRAFT_CAPTURE_FLAG_LENGTH					1
#define SPDH_TAG_ECHO_DATA							0x9F891B	//Q
#define ECHO_DATA_LENGTH							16
#define SPDH_TAG_CARD_TYPE							0x9F891C	//R
#define CARD_TYPE_LENGTH							1
#define SPDH_TAG_INVOICE_NUMBER						0x9F891D	//S
#define INVOICE_NUMBER_LENGTH						10
#define SPDH_TAG_INVOICE_NUMBER_ORIGINAL			0x9F891E	//T
#define INVOICE_NUMBER_ORI_LENGTH					10
#define SPDH_TAG_LANGUAGE_CODE						0x9F891F	//U
#define LANGUAGE_CODE_LENGTH						1
#define SPDH_TAG_MAIL_DOWNLOAD_KEY					0x9F8920	//V
#define MAIL_DOWNLOAD_KEY_LENGTH					15
#define SPDH_TAG_MAIL_TEXT_DOWNLOAD_DATA			0x9F8921	//W
#define SPDH_TAG_MAIL_TEXT_DOWNLOAD_DATA_PART2		0x9F8922
#define SPDH_TAG_MAIL_TEXT_DOWNLOAD_DATA_PART3		0x9F8923
#define SPDH_TAG_MAIL_TEXT_DOWNLOAD_DATA_PART4		0x9F8924
#define MAIL_TEXT_DOWNLOAD_DATA_LENGTH				957
#define SPDH_TAG_ISO_RESPONSE_CODE					0x9F8925	//X
#define ISO_RESPONSE_CODE_LENGTH					3
#define SPDH_TAG_CUSTOMER_ZIP_CODE					0x9F8926	//Y
#define CUSTOMER_ZIP_CODE_LENGTH					9
#define SPDH_TAG_ADDRESS_VERIF_STATUS_CODE			0x9F8927	//Z
#define ADDRESS_VERIF_STATUS_CODE_LENGTH			9
#define SPDH_TAG_OPTIONAL_DATA						0x9F8928    //a
#define OPTIONAL_DATA_LENGTH						250
#define SPDH_TAG_PIN_CUSTOMER						0x9F8929    //b
#define PIN_CUSTOMER_LENGTH							16
#define SPDH_TAG_PIN_SUPERVISOR						0x9F892A    //c
#define PIN_SUPERVISOR_LENGTH						16
#define SPDH_TAG_RETAILER_ID						0x9F892B    //d
#define RETAILER_ID_LENGTH							12
#define SPDH_TAG_POS_CONDITION_CODE					0x9F892C    //e
#define POS_CONDITION_CODE_LENGTH					2
#define SPDH_TAG_PIN_LEN_RECEIPT_DATA				0x9F892D    //f
#define PIN_LEN_RECEIPT_DATA_LENGTH					200
#define SPDH_TAG_RESPONSE_DISPLAY					0x9F892E    //g
#define RESPONSE_DISPLAY_LENGTH						48
#define SPDH_TAG_SEQUENCE_NUMBER					0x9F892F    //h
#define SEQUENCE_NUMBER_LENGTH						10
#define SPDH_TAG_SEQUENCE_NUMBER_ORIGINAL			0x9F8930    //i
#define SEQUENCE_NUMBER_ORIGINAL_LENGTH				9
#define SPDH_TAG_STATE_CODE							0x9F8931    //j
#define STATE_CODE_LENGTH							2
#define SPDH_TAG_TERMINAL_LOCATION					0x9F8932    //k
#define TERMINAL_LOCATION_LENGTH					25
#define SPDH_TAG_TOTAL_BATCH						0x9F8933	//l
#define TOTAL_BATCH_LENGTH							75
#define SPDH_TAG_TOTAL_DAY							0x9F8934	//m
#define TOTAL_DAY_LENGTH							75
#define SPDH_TAG_TOTAL_EMPLOYEE						0x9F8935	//n
#define TOTAL_EMPLOYEE_LENGTH						121
#define SPDH_TAG_TOTAL_SHIFT						0x9F8936	//o
#define TOTAL_SHIFT_LENGTH							75
#define SPDH_TAG_TRACK2_CUSTOMER					0x9F8937    //q
#define TRACK2_CUSTOMER_LENGTH						40
#define SPDH_TAG_TRACK2_SUPERVISOR					0x9F8938    //r
#define TRACK2_SUPERVISOR_LENGTH					40
#define SPDH_TAG_TRANSACTION_DESCRIPTION			0x9F8939    //s
#define TRANSACTION_DESCRIPTION_LENGTH				24
#define SPDH_TAG_PINPAD_ID							0x9F893A    //t
#define PINPAD_ID_LENGTH							16
#define SPDH_TAG_ACCEPTOR_POSTING_DATE				0x9F893B    //u
#define ACCEPTOR_POSTING_DATE_LENGTH				6
#define SPDH_TAG_AMEX_DATA							0x9F893C    //0
#define AMEX_DATA_LENGTH							118
#define SPDH_TAG_PS2000_DATA						0x9F893D    //1
#define PS2000_DATA_LENGTH							24
#define SPDH_TAG_TRACK1_CUSTOMER					0x9F893E    //2
#define TRACK1_CUSTOMER_LENGTH						82
#define SPDH_TAG_TRACK1_SUPERVISOR					0x9F893F    //3
#define TRACK1_SUPERVISOR_LENGTH					82
#define SPDH_TAG_INDUSTRY_DATA						0x9F8940    //4
#define INDUSTRY_DATA_LENGTH						171
#define SPDH_TAG_PRODUCT_SUBFIDS_6					0x9F8941    //6
#define PRODUCT_SUBFIDS_6_LENGTH					0
#define SPDH_TAG_HOST_ORIGINAL_DATA_6				0x9F8942	//6-A
#define HOST_ORIGINAL_DATA_6_LENGTH					12
#define SPDH_TAG_CVD_CUSTOMER_6						0x9F8943	//6-B
#define CVD_CUSTOMER_6_LENGTH						4
#define SPDH_TAG_CVD_ADMINISTRATIVE_6				0x9F8944	//6-C
#define CVD_ADMINISTRATIVE_6_LENGTH					4
#define SPDH_TAG_PURCHASING_CARD_6					0x9F8945	//6-D
#define PURCHASING_CARD_6_LENGTH					876
#define SPDH_TAG_POS_ENTRY_MODE_6					0x9F8946	//6-E
#define POS_ENTRY_MODE_6_LENGTH						3
#define SPDH_TAG_ELECTRONIC_COM_DATA_6				0x9F8947	//6-F
#define ELECTRONIC_COM_DATA_6_LENGTH				2
#define SPDH_TAG_VISA_COM_INDICATOR_6				0x9F8948	//6-G
#define VISA_COM_INDICATOR_6_LENGTH					1
#define SPDH_TAG_CVD_RESULT_6						0x9F8949	//6-H
#define CVD_RESULT_6_LENGTH							2
#define SPDH_TAG_TRAN_CUR_CODE_6					0x9F894A	//6-I
#define TRAN_CUR_CODE_6_LENGTH						3
#define SPDH_TAG_CARH_CERTIF_SER_NUMBER_6			0x9F894B	//6-J
#define CARH_CERTIF_SER_NUMBER_6_LENGTH				32
#define SPDH_TAG_MERCH_CERTIF_SER_NUMBER_6			0x9F894C	//6-K
#define MERCH_CERTIF_SER_NUMBER_6_LENGTH			32
#define SPDH_TAG_XID_6								0x9F894D	//6-L
#define XID_6_LENGTH								80
#define SPDH_TAG_REASON_ONLINE_CODE_6				0x9F894E	//6-N
#define REASON_ONLINE_CODE_6_LENGTH					4
#define SPDH_TAG_EMV_REQ_DATA_6						0x9F894F	//6-O
#define EMV_REQ_DATA_6_LENGTH						136
#define SPDH_TAG_EMV_ADD_REQ_DATA_6					0x9F8950	//6-P
#define EMV_ADD_REQ_DATA_6_LENGTH					64
#define SPDH_TAG_EMV_RESP_DATA_6					0x9F8951	//6-Q
#define EMV_RESP_DATA_6_LENGTH						64
#define SPDH_TAG_EMV_ADD_RESP_DATA_6				0x9F8952	//6-R
#define EMV_ADD_RESP_DATA_6_LENGTH					258
#define SPDH_TAG_STORED_VALUE_DATA_6				0x9F8953	//6-S
#define STORED_VALUE_DATA_6_LENGTH					63
#define SPDH_TAG_KEY_SER_NUMBER_6					0x9F8954	//6-T
#define KEY_SER_NUMBER_6_LENGTH						23
#define SPDH_TAG_TRAN_SUBTYPE_DATA_6				0x9F8955	//6-U
#define TRAN_SUBTYPE_DATA_6_LENGTH					16
#define SPDH_TAG_AUTH_COLLECTION_INDICATOR_6		0x9F8956	//6-V
#define AUTH_COLLECTION_INDICATOR_6_LENGTH			1
#define SPDH_TAG_CAV_AAV_RES_CODE_6					0x9F8957	//6-W
#define CAV_AAV_RES_CODE_6_LENGTH					1
#define SPDH_TAG_POINT_SERVICE_DATA_6				0x9F8958	//6-X
#define POINT_SERVICE_DATA_6_LENGTH					6
#define SPDH_TAG_AUTH_DATA_6						0x9F8959	//6-Y
#define AUTH_DATA_6_LENGTH							202
#define SPDH_TAG_CARD_VERIF_FLAG2_6					0x9F895A	//6-Z
#define CARD_VERIF_FLAG2_6_LENGTH					1
#define SPDH_TAG_CHECK_CONV_DATA_6					0x9F895B	//6-b
#define CHECK_CONV_DATA_6_LENGTH					39
#define SPDH_TAG_MICR_DATA_6						0x9F895C	//6-c
#define MICR_DATA_6_LENGTH							64
#define SPDH_TAG_CHECK_CALLBACK_INFO_6				0x9F895D	//6-d
#define CHECK_CALLBACK_INFO_6_LENGTH				115
#define SPDH_TAG_INTERCHANGE_COMPLIANCE_DATA_6		0x9F895E	//6-e
#define INTERCHANGE_COMPLIANCE_DATA_6_LENGTH		21
#define SPDH_TAG_RESP_SOURCE_REASON_CODE_6			0x9F895F	//6-f
#define RESP_SOURCE_REASON_CODE_6_LENGTH			1
#define SPDH_TAG_POS_MERCHANT_DATA_6				0x9F8960	//6-g
#define POS_MERCHANT_DATA_6_LENGTH					4
#define SPDH_TAG_PRODUCT_SUBFIDS_7					0x9F8961
#define PRODUCT_SUBFIDS_7_LENGTH					50
#define SPDH_TAG_PRODUCT_SUBFIDS_8					0x9F8962
#define PRODUCT_SUBFIDS_8_LENGTH					50
#define SPDH_TAG_EBT_VOUCHER_AVAILBALANCE_8			0x9F8963	//8-A
#define EBT_VOUCHER_AVAILBALANCE_8_LENGTH			24
#define SPDH_TAG_EBT_AVAILABLE_BALANCE_8			0x9F8964	//8-B
#define EBT_AVAILABLE_BALANCE_8_LENGTH				18
#define SPDH_TAG_CUSTOMER_SUBFIDS					0x9F8965
#define CUSTOMER_SUBFIDS_LENGTH						50

#define SPDH_TAG_RESPONSECODE_VALUE					0x9F8966
#define RESPONSECODE_LENGTH							2
#define SPDH_TAG_AUTHORIZATION_STATUS				0x9F8967
#define AUTHORIZATION_STATUS_LENGTH					1
#define SPDH_TAG_AUTHORIZATION_MESSAGE1				0x9F8968
#define AUTHORIZATION_MESSAGE_LENGTH				21
#define SPDH_TAG_AUTHORIZATION_MESSAGE2				0x9F8969

#define SPDH_EMV_SMART_CARD_SCHEME_O                0x9F8970
#define EMV_SMART_CARD_SCHEME_O_LENGTH              2
#define SPDH_EMV_SMART_CARD_SCHEME_P                0x9F8971
#define EMV_SMART_CARD_SCHEME_O_LENGTH              2
#define SPDH_EMV_CRYPTOGRAM_CURRENCY_CODE           0x9F8972
#define EMV_CRYPTO_CURRENCY_CODE_LENGTH             2
#define SPDH_EMV_CRYPTOGRAM_AMOUNT                  0x9F8973
#define EMV_CRYPTO_AMOUNT_LENGTH                    12


// SPDH DIDs
#define SPDH_TAG_USER_DIDA							0x9F8980
#define SPDH_TAG_USER_DIDB							0x9F8981
#define SPDH_TAG_USER_DIDC							0x9F8982
#define SPDH_TAG_USER_DIDD							0x9F8983
#define SPDH_TAG_USER_DIDE							0x9F8984
#define SPDH_TAG_USER_DIDF							0x9F8985
#define SPDH_TAG_USER_DIDG							0x9F8986
#define SPDH_TAG_USER_DIDH							0x9F8987
#define SPDH_TAG_USER_DIDI							0x9F8988
#define SPDH_TAG_USER_DIDJ							0x9F8989
#define SPDH_TAG_USER_DIDK							0x9F898A
#define SPDH_TAG_USER_DIDL							0x9F898B
#define SPDH_TAG_USER_DIDM							0x9F898C
#define SPDH_TAG_USER_DIDN							0x9F898D
#define SPDH_TAG_USER_DIDO							0x9F898E
#define SPDH_TAG_USER_DIDP							0x9F898F
#define SPDH_TAG_USER_DIDQ							0x9F8990
#define SPDH_TAG_USER_DIDR							0x9F8991
#define SPDH_TAG_USER_DIDS							0x9F8992
#define SPDH_TAG_USER_DIDT							0x9F8993
#define SPDH_TAG_USER_DIDU							0x9F8994
#define SPDH_TAG_USER_DIDV							0x9F8995
#define SPDH_TAG_USER_DIDW							0x9F8996
#define SPDH_TAG_USER_DIDX							0x9F8997
#define SPDH_TAG_USER_DIDY							0x9F8998
#define SPDH_TAG_USER_DIDZ							0x9F8999
#define USER_DID_LENGTH								40
#define SPDH_TAG_DID_TERM_LOCATION					0x9F899A
#define DID_TERM_LOCATION_LENGTH					25
#define SPDH_TAG_DID_TERM_CITY_STATE				0x9F899B
#define DID_TERM_CITY_STATE_LENGTH					16
#define SPDH_TAG_DID_TERM_OWNER						0x9F899C
#define DID_TERM_OWNER_LENGTH						22
#define SPDH_TAG_DID_SERV_INFO						0x9F899D
#define DID_SERV_INFO_LENGTH						88
#define SPDH_TAG_DID_PIN_WORKKEY					0x9F899E
#define DID_PIN_WORKKEY_LENGTH						74
#define SPDH_TAG_DID_MAC_WORKKEY					0x9F899F
#define DID_MAC_WORKKEY_LENGTH						74
#define SPDH_TAG_DID_PINPAD_CHARACTER				0x9F89A0
#define DID_PINPAD_CHARACTER_LENGTH					1
#define SPDH_TAG_DID_DATA_ENCRYPTION_KEY			0x9F89A1
#define DID_DATA_ENCRYPTION_KEY_LENGTH				16
#define SPDH_TAG_DID_SERVICE						0x9F89A2
#define SPDH_TAG_DID_SERVICE_PART1					0x9F89A3
#define SPDH_TAG_DID_SERVICE_PART2					0x9F89A4
#define SPDH_TAG_DID_SERVICE_PART3					0x9F89A5
#define SPDH_TAG_DID_SERVICE_PART4					0x9F89A6
#define DID_SERVICE_LENGTH							1170
#define SPDH_TAG_DID_LIMITS							0x9F89A7
#define DID_LIMITS_LENGTH							44
#define SPDH_TAG_DID_ALLOWED_TRANS					0x9F89A8
#define DID_ALLOWED_TRANS_LENGTH					30
#define SPDH_TAG_DID_RETAILER_ID					0x9F89A9
#define DID_RETAILER_ID_LENGTH						19
#define SPDH_TAG_DID_MERCHANT_NAME					0x9F89AA
#define DID_MERCHANT_NAME_LENGTH					40
#define SPDH_TAG_DID_REFERRAL_PHONE					0x9F89AB
#define DID_REFERRAL_PHONE_LENGTH					20
#define SPDH_TAG_DID_RESERVED						0x9F89AC
#define DID_RESERVED_LENGTH							1
#define SPDH_TAG_DID_CARDPREFIX_0					0x9F89AD
#define SPDH_TAG_DID_CARDPREFIX_1					0x9F89AE
#define SPDH_TAG_DID_CARDPREFIX_2					0x9F89AF
#define SPDH_TAG_DID_CARDPREFIX_3					0x9F89B0
#define SPDH_TAG_DID_CARDPREFIX_4					0x9F89B1
#define SPDH_TAG_DID_CARDPREFIX_5					0x9F89B2
#define SPDH_TAG_DID_CARDPREFIX_6					0x9F89B3
#define SPDH_TAG_DID_CARDPREFIX_7					0x9F89B4
#define SPDH_TAG_DID_CARDPREFIX_8					0x9F89B5
#define SPDH_TAG_DID_CARDPREFIX_9					0x9F89B6
#define SPDH_TAG_DID_CARDPREFIX_10					0x9F89B7
#define SPDH_TAG_DID_CARDPREFIX_11					0x9F89B8
#define SPDH_TAG_DID_CARDPREFIX_12					0x9F89B9
#define SPDH_TAG_DID_CARDPREFIX_13					0x9F89BA
#define SPDH_TAG_DID_CARDPREFIX_14					0x9F89BB
#define SPDH_TAG_DID_CARDPREFIX_15					0x9F89BC
#define SPDH_TAG_DID_CARDPREFIX_16					0x9F89BD
#define SPDH_TAG_DID_CARDPREFIX_17					0x9F89BE
#define SPDH_TAG_DID_CARDPREFIX_18					0x9F89BF
#define SPDH_TAG_DID_CARDPREFIX_19					0x9F89C0
#define SPDH_TAG_DID_CARDPREFIX_20					0x9F89C1
#define SPDH_TAG_DID_CARDPREFIX_21					0x9F89C2
#define SPDH_TAG_DID_CARDPREFIX_22					0x9F89C3
#define SPDH_TAG_DID_CARDPREFIX_23					0x9F89C4
#define SPDH_TAG_DID_CARDPREFIX_24					0x9F89C5
#define SPDH_TAG_DID_CARDPREFIX_25					0x9F89C6
#define SPDH_TAG_DID_CARDPREFIX_26					0x9F89C7
#define SPDH_TAG_DID_CARDPREFIX_27					0x9F89C8
#define SPDH_TAG_DID_CARDPREFIX_28					0x9F89C9
#define SPDH_TAG_DID_CARDPREFIX_29					0x9F89CA
#define DID_CARDPREFIX_LENGTH						108


// EMV data length definitions
#define TRACK2_EQU_DATA_LENGTH                      38
#define POS_ENTRY_MODE_CODE_LENGTH                  1
#define CRYPTO_INFORMATION_DATA_LENGTH              1
#define TR_CURRENCY_CODE_LENGTH                     3
#define TERMINAL_COUNTRY_CODE_LENGTH                2
#define TRANSACTION_DATE_LENGTH                     2
#define APPLI_CRYPTOGRAMME_AC_LENGTH                2
#define AIP_LENGTH                                  2
#define ATC_LENGTH                                  2
#define UNPREDICTABLE_NUMBER_LENGTH                 2
#define TVR_LENGTH                                  5
#define TRANSACTION_TYPE_LENGTH                     2
#define ISSUER_APPLICATION_DATA_LENGTH              32
#define APPLI_PRIM_ACCOUNT_NB_SEQ_LENGTH            2
#define TERMINAL_TYPE_LENGTH                        2



#define SPDH_TRACK_STX                              ';'
#define SPDH_TRACK_FS                               '='
#define SPDH_TRACK_ETX                              '?'

#define ISO_7813_STX                                'B'
#define ISO_7813_FS                                 'D'
#define ISO_7813_ETX                                'F'

#endif
